// =============================================================================
//  Spangles Analyzer
//
//  Copyright(c) 2008
//  See LICENSE.txt for licensing information.
// =============================================================================

package com.google.spangles.view;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.google.spangles.domain.Color;
import com.google.spangles.domain.Location;
import com.google.spangles.interfaces.impl.AbstractBounded;

/**
 * (Description)
 * (Any invariants [conditions that are always true] )
 * (Usage instructions, and/or examples)
 * (TODOs, ASSUMPTIONs, etc.)
 * (Known Bugs)
 * (Concurrency strategy - not thread safe or how it's thread safe)
 * 
 * @author Chris
 */
public class Visualization extends AbstractBounded
{
   Map<Location, VisualizationElement> display = new HashMap<Location, VisualizationElement>();
   
   public Collection<Location> locations()
   {
      return display.keySet();
   }

   /**
    * (Description - what the method does and why)
    * (Visibility decision, if not obvious)
    * (Pre/Post Conditions)
    * (Usage examples)
    * (Algorithmic notes)
    * (Concurrency issues)
    * @param location
    * @return
    */
   public VisualizationElement getElement(Location location)
   {
      return display.get(location);
   }

   /**
    * (Description - what the method does and why)
    * (Visibility decision, if not obvious)
    * (Pre/Post Conditions)
    * (Usage examples)
    * (Algorithmic notes)
    * (Concurrency issues)
    * @param l
    * @param c
    * @param pu
    */
   public void record(Location l, Color c, boolean pu)
   {
      display.put(l, new VisualizationElement(c, pu));      
   }
}
